<template>
	<view class="box">
		<view class="list">
			<view class="card flex" v-for="(item,index) of list" :key="index">
				<view class="img f-w">
					<image :src="item.img" mode=""></image>
				</view>
				<view class="right">
					<view class="one f-w">
						<view class="f28 bold">{{item.shop_name}}</view>
						<view class="f22 tag">生鲜好店</view>
					</view>
					<!-- 关注时间 -->
					<view class="two f22 c666" v-if="item.time">
						{{item.time}}关注
					</view>
					<view class="two f22 c666"  v-else>
						<view v-if="!item.time" style="color: #FFFFFF;">占位</view>
					</view>
					<view class="three">
						<view @click="goShop(item.id)">进店逛逛</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[
					{
						id:1,
						shop_name:'家慧超市（弹子石菜市场）',
						img:'https://jw.xzsw2021.com/static/index/tu_19@2x.png',
						rate:5.0,
						tag:'生鲜好店',
						num1:288,
						juli:'1.5',
						price:20,
						price2:5,
						time:'2021.12.14 15:30'
					},
					{
						id:2,
						shop_name:'家慧超市（南平菜市场）',
						img:'https://jw.xzsw2021.com/static/index/tu_19@2x.png',
						rate:5.0,
						tag:'生鲜好店',
						num1:288,
						juli:'1.5',
						price:20,
						price2:5,
					},
				],//
			}
		},
		methods: {
			// 进店逛逛
			goShop(id){
				uni.navigateTo({
					url:'/pages/client/shop/shop?id='+id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box{
		.list{
			padding: 10rpx 20rpx;
			.card{
				padding: 27rpx 0 20rpx;
				border-bottom: 1rpx solid #eee;
				.img{
					flex-shrink: 0;
					width: 120rpx;
					height: 120rpx;
					image{
						width: 100%;
						height: 100%;
						border-radius: 10rpx;
					}
				}
				.right{
					flex: 1;
					margin-left: 15rpx;
					.tag{
						padding: 2rpx 6rpx;
						background: linear-gradient(90deg, #00D058, #00C45A);
						border-radius: 4rpx;
						color: #fff;
					}
					.two{
						margin: 10rpx 0 10rpx;
						height: 28rpx;
					}
					.three{
						text-align: right;
						&>view{
							display: inline-block;
							width: 140rpx;
							height: 50rpx;
							line-height: 50rpx;
							text-align: center;
							font-size: 26rpx;
							background: #FFFFFF;
							border: 1rpx solid #CCCCCC;
							border-radius: 25rpx;
						}
					}
				}
			}
		}
	}
</style>
